package singleton;

import java.time.LocalDateTime;
import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;

public class QueueSingleton {

    private QueueSingleton() {
    }

    private static volatile Queue<LocalDateTime> rabbitConcurrentQueue;

    public static Queue<LocalDateTime> getRabbitConcurrentQueue() {
        if (rabbitConcurrentQueue == null) {
            synchronized (QueueSingleton.class) {
                if (rabbitConcurrentQueue == null) {
                    rabbitConcurrentQueue = new ArrayBlockingQueue<>(10);
                }
            }
        }
        return rabbitConcurrentQueue;
    }

}
